#include <stdio.h>

#define TEST_FILE_NAME "17_Test.txt"

int main(int argc, char const *argv[])
{
    FILE * fpDst = fopen( TEST_FILE_NAME, "w+" );
    if( NULL == fpDst )
    {
        printf( "Fail to open file\n" );
        return -1;
    }

    int Num1 = 100;
    float Num2 = 12.3;
    fprintf( fpDst, "Num1 = %d, Num2 = %f", Num1, Num2 );

    rewind( fpDst );

    int Num1_R = 0;
    float Num2_R = 0;

    fscanf( fpDst,"Num1 = %d, Num2 = %f", &Num1_R, &Num2_R );
    printf(  "fsanf result:\nNum1 = %d, Num2 = %f\n", Num1_R, Num2_R );
    fclose( fpDst );

    return 0;
}


/*

函数 fscanf

*/